package com.ljy.controller.admin;

import com.ljy.entity.ShopCategory;
import com.ljy.result.Result;
import com.ljy.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;

    @GetMapping
    public Result<List<ShopCategory>> list(){
        List<ShopCategory>list=categoryService.list();
        return Result.success(list);
    }
}
